113
Create Your Own Interface Diagram
113
STEP 3 & 4—draw arrow function continued 3
Worksheets(“IdenticalPairs”).Cells(j, 3).Value = Sheets(CurrentSheetName).
Cells(i, 3).Value
LabelToHighlight = Sheets(CurrentSheetName).Cells(FoundPair, 1).Value & “-1”
On Error Resume Next
ActiveSheet.Shapes.Range(Array(LabelToHighlight)).Select
On Error Resume Next
Selection.ShapeRange(1).Fill.ForeColor.RGB = RGB(255, 255, 0) ‘yellow
highlight
LabelToHighlight = Sheets(CurrentSheetName).Cells(FoundPair, 1).Value & “-2”
On Error Resume Next
ActiveSheet.Shapes.Range(Array(LabelToHighlight)).Select
On Error Resume Next
Selection.ShapeRange(1).Fill.ForeColor.RGB = RGB(255, 255, 0) ‘yellow
highlight
End If
End Sub
LabelObjectNumber = LabelObjectNumber + 1
LinesInLabel(LabelObjectNumber) = 1
LabelObject(LabelObjectNumber) = Label2
Set rng = Range(Cells(LabelRow - 2, LabelCol - 4), Cells(LabelRow,
LabelCol - 3))
With rng
Set MyRct = ActiveSheet.Shapes.AddLabel(msoTextOrientationHorizontal,
.Left, .Top, .Width, .Height)
MyRct.Name = Sheets(CurrentSheetName).Cells(i, 1).Value & “-2”
MyRct.TextFrame2.TextRange.Characters.Text = i & “.” &
Sheets(CurrentSheetName).Cells(i, 3).Value
MyRct.TextFrame2.TextRange.Characters.Font.Size = 6
MyRct.TextFrame2.VerticalAnchor = msoAnchorBottom
MyRct.TextFrame2.TextRange.ParagraphFormat.Alignment = msoAlignLeft
MyRct.TextFrame2.TextRange.Characters.Font.Fill.ForeColor.
RGB = RGB(255, 0, 0)
MyRct.TextFrame2.AutoSize = msoAutoSizeShapeToFitText
End With
End If
Else
If ShapeExists(Label) Then
Selection.ShapeRange.TextFrame2.TextRange.Characters.Text = Selection.
ShapeRange.TextFrame2.TextRange.Characters.Text & Chr(10) & i & “.” &
Sheets(CurrentSheetName).Cells(i, 3).Value
For kk = 1 To LabelObjectNumber
If LabelObject(kk) = Label Then
LinesInLabel(kk) = LinesInLabel(kk) + 1
End If
Next
Else
LabelObjectNumber = LabelObjectNumber + 1
LinesInLabel(LabelObjectNumber) = 1
LabelObject(LabelObjectNumber) = Label